{include file='header.html'}
<style type="text/css">
<!--
body {
	margin-left: 3px;
	margin-top: 1px;
	margin-right: 3px;
	margin-bottom: 1px;
	background-color: #1D3647;
}
.nobgcolortbl{
    text-align:left;
    background-image: url(../img/login-content-bg.gif);
    background-repeat: repeat;
    background-size: 100% 100%;
}
-->
</style>
<script type="text/javaScript">
//-
function preventBack() { window.history.forward(); };

if(true){
    //-
    //- disable back btn
    //- Wed Mar 25 11:30:35 HKT 2020
    var watch4BackBtnI = window.setTimeout("preventBack()", 0);
    window.onunload = function () { null };
    window.onload = function(){ preventBack(); };
    //-
    window.history.pushState(null, null, location.href);
    window.onpopstate = function () {
        window.history.go(1);
    };

    //-
    //- go to top window
    //- added by Xenxin@ufqi.com, Tue Sep 13 09:43:42 CST 2016
    if (top.frames.length>0){
        window.setTimeout("top.location = window.location;",100);
    }
	
	//- anti timeout for verifycode
    //- Thu Apr  2 10:33:13 CST 2020
    if(true){
        var try2Reloadi = window.setTimeout(function(){
                    window.console.log((new Date())+" try reloading signin page....");
                    window.location.reload();
                }, 
            5*60*1000); // 5 minutes    
    }
}
</script>
<table style="border:0px;width:100%;height:566px;border-collapse:collapse; border-spacing:0px;"
	class="login_top_bg" > <!-- height="566px" border="0px" cellpadding="0" cellspacing="0" -->
  <tr >
        <td height="38px">&nbsp;</td>
        <td >&nbsp;</td>
        <td >&nbsp;</td>
  </tr>
  <tr class="nobgcolortbl">
    <td style="height:560px;vertical-align:middle"  >

            <table style="background:transparent;border:0px;width:100%;border-collapse:collapse; border-spacing:0px;">
            	<!-- width="100%" border="0px" cellpadding="0" cellspacing="0" -->
                <tr>
                  <td  style="text-align:center;" colspan="3" height="80" valign="top">
				    <span class="login_txt_bt" 
                        		style="color:#ABCAD3;font-weight:bold;font-size:36px;font-family:Tahoma,Geneva,sans-serif;">
                        			{$lang['agentname']}
                        	</span>
                    <br/><strong><i>With</i></strong><br/>
                    
                    <a href="#">
                        <img src="../upld/your_logo.jpg" title="-YourSite"
                            style="width:18%;"
                            />
                    </a>
                     &nbsp; &nbsp;&nbsp;&nbsp;
                    <a href="#-gmis" target="_blank" title="gMIS" 
                        style="font-size:18px;font-weight:bold" target="_blank">
                            <!-- <i>g</i>MIS -->
                            <img src="../img/gmis-icon-192.png" alt="gmis" style="width:28%;" />
                    </a>
				  </td>
                </tr>
             </table>

        </td>
        <td width="2%" >&nbsp;</td>
        <td width="61%" valign="bottom" style="vertical-align:middle" >
        
            <form name="myform" action="{$action}" method="post">
                <table id="table212" 
                	style="background:transparent;border:0px;width:100%;heiht:143px;
                		border-collapse:collapse; border-spacing:0px;">
                    <tr style="background-image:url(../img/login-wel.gif);">
                        <td colspan="2" height="48" style="vertical-align:middle">&nbsp;</td>
                    </tr>

                    <tr style="background:transparent">
                        <td width="2%">&nbsp;</td>
                        <td width="96%" height="48" style="vertical-align:middle">
                        	<span class="login_txt_bt" 
                        		style="color:#ABCAD3;font-weight:bold;font-size:16px;font-family:Tahoma,Geneva,sans-serif;">
                        			{$lang['agentname']}
                        	</span>
                        </td>
                    </tr>
				{if $islan==false}
				<tr>
                    <td width="13%" height="35" ></td>
                    <td height="35" colspan="2" class="top_hui_text">
                    	<img src="{$rtvdir}/comm/imagex.php?i={$verifyid}&rdi={$randi}" alt="-x-" 
                    		ondblclick="javascript:window.location.reload();" 
                    			id="verifycodeimg2" title="双击刷新" width="200px" /> &nbsp;
                    	<a href="javascript:void(0);" 
                    		onclick="javascript:window.location.reload();">
                    		Unrecognized 看不清?
                    	</a>
                      </td>
                  </tr>
				<tr>
                    <td width="13%" height="35" ><span class="login_txt">验证码Vfc：</span></td>
                    <td height="35" colspan="2" class="top_hui_text">
                    	<input name="verifycode" id="verifycode" autocomplete="off"
							type="text" maxLength="5" onload="javascript:this.focus();"
							style="font-size:16px;font-weight:bold;" title="验证码不区分大小写, Code Case-Insensitive">
                    	&nbsp;&nbsp;<span id="verifycoderesult" style="font-size:20px;"></span>
                      </td>
                  </tr>
                  {/if}
                  <tr>
                    <td width="13%" height="38" class="top_hui_text" nowrap>
                    	<span class="login_txt">用户电子邮箱Uid：&nbsp;&nbsp; </span></td>
                    <td height="38" colspan="2" class="top_hui_text">
                    	<input name="email" id="email" class="editbox4" value="" size="32"
							style="font-size:16px;font-weight:bold;">
							{if $islan==true}							
                    		<script>var emailtag = document.getElementById('email'); emailtag.focus();</script>
							{/if}
                    </td>
                  </tr>
                  <tr>
                    <td width="13%" height="35" class="top_hui_text">
                    <span class="login_txt"> 密 码Pwd： &nbsp;&nbsp; </span></td>
                    <td height="35" colspan="2" class="top_hui_text">
                    	<input class="editbox4" type="password" size="20" name="password" id="password"
							style="font-size:16px;font-weight:bold;">
                      <img src="../img/luck.gif" width="19" height="18"> </td>
                  </tr>
                 
                  <tr>
                    <td height="35" >
                    	<input type="submit" class="button" id="Submit"> </td>
                    <td width="37%" class="top_hui_text">
                    	<input name="cs" type="reset" class="button" id="resetbtn" />
                    	&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
                    	<input name="cs" type="button" class="button" id="helpbtn" value="Help"
                    		onclick="javascript:document.location.href='mailto:{$adminmail}?subject=gMIS';" />
                    </td>
                  </tr>

                </table>
                <input type="hidden" name="bkl" id="bkl" value="{$bkl}"/>
                <input type="hidden" name="verifyid" id="verifyid" value="{$verifyid}"/>
            </form>
       </td> 
  </tr>
</table>
<script async type="text/javascript">
//- verifycode validate in sync mode, Sep 08, 2018
var verifyCodeTimer = 0; 
var hasVerifyTrue = false;
var lastVerifyCode = '';
var ReTimerDelay = 3 * 1000;
var vfcObj = document.getElementById('verifycode');
var respDispObj = document.getElementById('verifycoderesult');
function checkVerifyCode(){
   var vfc = '';
   if(vfcObj){
		vfc = vfcObj.value;
   }
   if(vfc.length >= 4 && vfc != lastVerifyCode){
		var vidObj = document.getElementById('verifyid');
		var vid = '';
		if(vidObj){ vid = vidObj.value; }
		var mygtajax = new GTAjax();
		var verifyUrl = '{$url}&act=checkverifycode&fmt=json'
			+'&verifycode='+vfc
			+'&verifyid='+vid;
		mygtajax.set('returndataonly', true);
		mygtajax.set('callback', function(){
				var resp = this;
				console.log('resp:['+resp+']');
				if(resp.indexOf('<pre') > -1){
					var resp_1 = /<pre[^>]*>([^<]*)<\/pre>/g;
					var resp_2 = resp_1.exec(resp);
					resp = resp_2[1];
				}
				var json_resp = JSON.parse(resp);
				var iResult = json_resp.verifyresult; 
				var respDispObj = document.getElementById('verifycoderesult');
				if(!respDispObj){ respDispObj = new Object(); }
				if(iResult){
					console.log("verify passed.["+iResult+"]");
					respDispObj.innerHTML = '<span style="color:green;">&#10004;</span>';
				}
				else{
					console.log("verify failed.["+iResult+"]");
					respDispObj.innerHTML = '<span style="color:red;">&#10008;</span>';
					verifyCodeTimer = window.setTimeout(checkVerifyCode, 3*1000);
					console.log("continue trying again....");
				}
			});
		var srvRtn = mygtajax.get(verifyUrl);
		lastVerifyCode = vfc;
   }
   else if(!hasVerifyTrue){
		verifyCodeTimer = window.setTimeout(checkVerifyCode, ReTimerDelay);
		console.log((new Date())+"continue monitoring....");
		var tmpVal = respDispObj.innerHTML;
		tmpVal = '.' + tmpVal;
		if(tmpVal.substring(0, 6) == '......'){ tmpVal = '.' + tmpVal.substring(6); }
		respDispObj.innerHTML = tmpVal;
   }
}
verifyCodeTimer = window.setTimeout(checkVerifyCode, ReTimerDelay);
vfcObj.focus();
</script>
{include file='footer.html'}
